import request from '@/utils/request'
import requestJava from '@/utils/requestJava.js'

export default {
  /**
   * 云平台登录请求
   * @param {Object} data
   */
  async cloudLogin(data) {
    return await request(
      {
        url: '/index/Index/login',
        data: data,
        method: 'POST',
      },
      true
    )
  },

  /**
   * 云平台组织架构 人员树  type user dept role
   * @param {Object} data
   */
  async getGroupData(data) {
    return await request({
      url: '/form/FormGroup/tree',
      data: data,
      method: 'POST',
    })
  },

  /**
   * 云平台
   * @param {Object} data
   */
  async getDeptUser(data) {
    return await request({
      url: '/form/FormGroup/user',
      data: data,
      method: 'POST',
    })
  },

  /**
   * 云平台-根据部门ID查询人员
   * @param {Object} data
   */
  async getUserByDept(data) {
    return await request({
      url: '/index/Worker/worker_list_search',
      data: data,
      method: 'POST',
    })
  },

  /**
   * 获取备货单
   * @param {Object} data
   */
  async getStockList(data) {
    return await request(
      {
        url: '/interface/public/index.php/yun/Cpku/get_num_order',
        data: data,
        method: 'POST',
        contentType: 1,
        channel: 3,
      },
      true
    )
  },

  /**
   * 云平台修改密码
   * @param {Object} data
   */
  async updatePWD(data) {
    return await request({
      url: '/index/Worker/update_pwd',
      data: data,
      method: 'POST',
    })
  },

  /**
   * 通知公告
   * @param {Object} data
   */
  async gzt_carousel(data) {
    return await request({
      url: '/index/Notice/gzt_carousel',
      data: data,
      method: 'POST',
    })
  },

  /**
   * 更新头像
   * @param {Object} data
   */
  async update_avatar(data) {
    return await request({
      url: '/index/Worker/update_avatar',
      data: data,
      method: 'POST',
    })
  },

  /**
   * 校验图形验证码
   * @param {Object} data
   */
  async checkCaptcha(data) {
    return await request({
      url: '/index/Index/checkCaptcha',
      data: data,
      method: 'POST',
    })
  },

  /**
   * 发送短信验证码
   * @param {Object} data
   */
  async sendSms(data) {
    return await request({
      url: '/index/kaoqin/send_hk_ms',
      data: data,
      method: 'POST',
    })
  },

  /**
   * 修改密码
   * @param {Object} data
   */
  async resetPassword(data) {
    return await request({
      url: '/index/index/resetPassword',
      data: data,
      method: 'POST',
    })
  },

  /**
   * 群聊组织架构
   * @param {Object} data
   */
  async WorkerTree(data) {
    return await request({
      url: '/index/Worker/tree',
      data: data,
      method: 'POST',
    })
  },

  /**
   * 更换手机号
   * @param {Object} data
   */
  async updatePhone(data) {
    return await request({
      url: '/index/Worker/update_phone',
      data: data,
      method: 'POST',
    })
  },
}
